<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>margin负值的巧妙运用</title>
    <style>
        ul li{
            list-style: none;
            width: 150px;
            height: 200px;
            float: left;
            margin-left: -1px;
            border: red solid 1px;
        }
        ul li:hover{
            /* 如果盒子没有定位 则添加相对定位即可 */
            position: relative;
            border:skyblue solid 1px;
        } 
        /* ul li:hover{
            如果li有定位则添加z-index: ;即可 
            z-index: 1;
            border:skyblue solid 1px;
        } */
    </style>
</head>
<body>
    <ul>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
    </ul>
</body>
</html>